<template>
	<view>
		<cu-custom bgColor="bg-blue-light" 
		title="工程领域拖欠农民工工资"></cu-custom>
		<view class="bg-blue-light" style="height: 150rpx;border-radius: 0 0 50rpx 50rpx;">
		</view>
		<view class="card" style="height: 368rpx;margin-top: -150rpx;">
			<view class="head">
				请填写拖欠工资单位相关信息
			</view>
			<zh-input v-model="entryname" type="text" label="拖欠工资项目名称"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入项目名称"></zh-input>
			<zh-input v-model="aae006" type="text" label="拖欠工资项目地址"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入项目地址"></zh-input>
			<zh-address
				label="所在地区"
				:required="true" 
				labelWidth="150rpx"
				labelAlign="left"
				placeholder="请选择省市区"
				justifyContent="space-between"
				ref='addressSelect'
				addressRef="addressSelect"
				:value="aab301"
				rightIconClass="text-gray"
				
			>
			</zh-address>
		</view>
		<view class="card" style="height: 540rpx;">
			<view class="head">
				请填写相关承包信息
			</view>
			<zh-input v-model="aab004" type="text" label="建设单位名称"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入单位名称"></zh-input>
			<zh-input v-model="aab013" type="text" label="总承包单位项目经理姓名"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入项目经理姓名"></zh-input>
			<zh-input v-model="generalconame" type="text" label="总承包单位名称"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入承包单位名称"></zh-input>
			<zh-input v-model="branchconame" type="text" label="分包单位名称"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入分包单位名称"></zh-input>
			<zh-input v-model="teamleader" type="text" label="班组长姓名"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入班组长姓名"></zh-input>
		</view>
		<view class="card" style="height: 91rpx;display:flex">
			<view class="head" style="border-bottom: 0px solid #DFDFDF;width: 300rpx;">
				是否政府投资项目
			</view>
			<view>
				<radio-group @change="RadioChange" class="yesOrNo">
					<view>
						<radio class='blue radio' style="transform: scale(0.5)" 
						:class="radio=='notProject'?'checked':''" 
						:checked="radio=='notProject'?true:false" value="notProject"></radio>
						<label class="selectText">是</label>
					</view>
					<view style="padding-left: 30rpx;">
						<radio class='blue radio' style="transform: scale(0.5)" 
						:class="radio=='project'?'checked':''" 
						:checked="radio=='project'?true:false" value="project"></radio>
						<label class="selectText">否</label>
					</view>
				</radio-group>
			</view>
		</view>
		<view class="card" style="height: 370rpx;">
			<view class="head">
				请填写反映人相关信息
			</view>
			<zh-input v-model="resname" type="text" label="反映人姓名"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入反映人姓名"></zh-input>
			<zh-input v-model="resphone" type="text" label="反映人电话"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入反映人电话"></zh-input>
			<zh-input v-model="residcard" type="text" label="反映人身份证号码"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入反映人身份证号码"></zh-input>
		</view>
		<view class="card" style="height: 370rpx;">
			<view class="head">
				请填写欠薪相关信息
			</view>
			<zh-input v-model="arrearnum" type="text" label="欠薪人数"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入欠薪人数"></zh-input>
			<zh-input v-model="arrearamount" type="text" label="欠薪金额"
			labelAlign="left" inputAlign="right" :required="true" 
			placeholder="请输入欠薪金额"></zh-input>
			<zh-picker
				pickerRef="accidentDate"
				mode="date"
				startYear="2000" 
				label="欠薪发生时间"
				themeColor="#FC7983"
				labelAlign="left"
				rightIconClass="text-gray"
				justifyContent="space-between"
				:value="arreartime"
				fields="day"
				ref="accidentDate"
				:required="true"
			   
			></zh-picker>
		</view>
		<view class="buttonParent">
			<view class="button flex flex-direction"
			style="padding-top: 10rpx;margin-left: 40rpx;">
				<button class="cu-btn shadow margin-tb-sm lg bg-blue-light"
				 style="background-color: #1388ED;" @tap="up">上一步</button>
			</view>
			<view class="button flex flex-direction" 
			style="padding-top: 10rpx;margin-left: 40rpx;">
				<button class="cu-btn shadow margin-tb-sm lg bg-blue-light"
				 style="background-color: #1388ED;" @tap="xiayi">下一步</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				entryname:'',
				aae006:'',
				aab301:'',
				aab004:'',
				aab013:'',
				generalconame:'',
				branchconame:'',
				teamleader:'',
				resname:'',
				resphone:'',
				residcard:'',
				arrearnum:'',
				arrearamount:'',
				arreartime:'',

				
			}
		},
		methods: {
			
			radio:function(){
				
			},
			up: function(){
						
						let a = this.$Router.back(1)
						        if (a == undefined) {
						        //重新定向跳转页面
						          this.$Router.replaceAll({ name:'noBackPayIndex'})
						        }
								else{
									this.$Router.back(1);
								}},
			xiayi: function(entryname,aae006,aab301,aab004,aab013,generalconame,branchconame,teamleader,resname,resphone,arrearnum,arreartime,residcard,arrearamount){
				if (!this.$validate.isPhone(this.resphone)) {
				  uni.showToast({
				    icon: 'none',
				    title: '请输入正确的反映人电话',
					duration:2000
				  })
				  return
				}
				if(this.aab004== "" || this.aab004==null){
					uni.showToast({
						title: '请输入建设单位名称',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.aab013== "" || this.aab013==null){
					uni.showToast({
						title: '请输入项目经理姓名',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.generalconame== "" || this.generalconame==null){
					uni.showToast({
						title: '请输入总承包单位名称',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.branchconame== "" || this.branchconame==null){
					uni.showToast({
						title: '请输入分包单位名称',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.teamleader== "" || this.teamleader==null){
					uni.showToast({
						title: '请输入班组长姓名',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.aae006== "" || this.aae006==null){
					uni.showToast({
						title: '请输入拖欠工资单位地址',
						icon: 'none',
						duration:2000
					});
					return
				}
				// if(this.aab301== "" || this.aab301==null){
				// 	uni.showToast({
				// 		title: '请输入所在地区',
				// 		icon: 'none',
				// 		duration:2000
				// 	});
				// 	return
				// }
				if(this.resname== "" || this.resname==null){
					uni.showToast({
						title: '请输入反映人姓名',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.resphone== "" || this.resphone==null){
					uni.showToast({
						title: '请输入反映人电话',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.residcard== "" || this.residcard==null){
					uni.showToast({
						title: '请输入反映人身份证号',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.arrearnum== "" || this.arrearnum==null){
					uni.showToast({
						title: '请输入欠薪人数',
						icon: 'none',
						duration:2000
					});
					return
				}
				// if(this.arreartime== "" || this.arreartime==null){
				// 	uni.showToast({
				// 		title: '请输入欠薪发生时间',
				// 		icon: 'none',
				// 		duration:2000
				// 	});
				// 	return
				// }
				if(this.arrearamount== "" || this.arrearamount==null){
					uni.showToast({
						title: '请输入欠薪金额',
						icon: 'none',
						duration:2000
					});
					return
				}
				if(this.cardType=='01'){
					if(!this.$validate.isIdcard(this.residcard)){
						uni.showToast({
						  icon: 'none',
						  title: '请输入正确的身份证号',
						  duration:2000
						})
						return
					}
				}
					console.log(111);
					this.$Router.push({
						name: 'projectForm2',
						params:{
							entryname:entryname,
							aab004:aab004,
							aab013:aab013,
							aab301:aab301,
							aae006:aae006,
							generalconame:generalconame,
							branchconame:branchconame,
							teamleader:teamleader,
							resname:resname,
							resphone:resphone,
							residcard:residcard,
							arrearnum:arrearnum,
							arrearamount:arrearamount,
							arreartime:arreartime,
							
						}
					});
					// this.$Router.push({
					// 	name: 'notProjectForm2'
					// }); 
					console.log(this.$Router.params);
					}
			},
			RadioChange(){
				
			}
			}
</script>

<style>
	page{
		background-color: #F6F6F6;
	}
	.card{
		background: #FFFFFF;
		border-radius: 20rpx;
		width: 690rpx;
		margin-left: 30rpx;
		margin-top: 20rpx;
	}
	.head{
		height: 87rpx;
		width: 690rpx;
		line-height: 87rpx;
		font-family: 'PingFangTC-Medium';
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
		letter-spacing: 0;
		padding-left: 30rpx;
		border-bottom: 1px solid #DFDFDF;
	}
	.yesOrNo{
		display:flex;
		height: 91rpx;
		padding-top: 15rpx;
		padding-left: 130rpx;
	}
	.buttonParent{
		margin-top: 20rpx;
		width: 690rpx;
		display: flex;
		margin-bottom: 70rpx;
	}
	.button{
		margin-top: 20rpx;
		width: 320rpx;
	}
</style>
